package com.loadmore.baselibrary;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;

import com.loadmore.baselibrary.bean.Event;
import com.loadmore.baselibrary.util.Constants;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/**
 * @author sunleilei
 * @date 2017/5/14
 */

public class BaseFragment extends Fragment {

    public Bundle bundle;
    public static String sign = null;
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        bundle = getArguments();
        sign = getClass().getSimpleName();
        Log.e(Constants.TAG,sign);

    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(Event event) {
        onEvent(event);
    }

    public void onEvent(Event event) {

    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }
}
